#include "mylog.h"
#include <QFile>
#include <QApplication>
#include <QDebug>
#include <QFileInfo>

void myLog::error(const char* filename,const char* funcname, const QByteArray& text)
{
    QFile errorlog(QApplication::applicationDirPath()+"/error.log");
    errorlog.open(QIODevice::Append|QIODevice::WriteOnly);
    errorlog.write("[");
    errorlog.write(QFileInfo(filename).fileName().toUtf8());
    errorlog.write("] ");
    errorlog.write(funcname);
    errorlog.write(": ");
    errorlog.write(text);
    errorlog.write("\n");
    errorlog.close();
}
